//
// Created on 2024/4/22.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#pragma once
#include <GLES3/gl3.h>
#include <string>
#include <map>
enum shaderType
{
    VertexShader,
    FragmentShader,
};
struct gles_shader
{
    char name[33];//最大32个字节的名字
    shaderType type;
    bool build;
    GLuint handle;
};
struct gles_program
{
    char name[33];
    gles_shader* vs;
    gles_shader* fs;
    bool build;
    GLuint handle;
};
class gles_shadermgr {
    public:
        static gles_shader *CreateShader(shaderType type, std::string name);
        static gles_shader *GetShader(shaderType type, std::string name);
        static bool SourceShader(gles_shader *shader, std::string code);
        static std::string GetShaderInfo(gles_shader *shader);

        static gles_program *CreateProgram(std::string name, gles_shader *vs, gles_shader *fs);
        static gles_program *GetPrograme(std::string name);
        static std::string GetProgramInfo(gles_program *prog);

    public : 

        static  void Init();

};


